package com.mybatis.service.impl;

import com.mybatis.Mapper.EmployeeMapper;
import com.mybatis.entity.Employee;
import com.mybatis.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;
    @Override
    public List<Employee> list() {
        return employeeMapper.list();
    }

    @Override
    public void delete(Integer id) {
        employeeMapper.deleteById(id);
    }

    @Override
    public void save(Employee employee) {
        employeeMapper.save(employee);
    }




    @Override
    public void remove(Employee employee) {
        employeeMapper.remove(employee);
    }

    @Override
    public int getById(Integer id) {
       return employeeMapper.getById(id);

    }


}
